//package com.inspur.edp.udt.generator.api.typeprocessers.datareaders;
//x
//import com.inspur.edp.udt.designtime.api.entity.element.UdtElement;
//import com.inspur.edp.udt.generator.UdtGeneratorContext;
//
////      生成代码例子
////     public enum StateEnum
////      {
////          ZD = 1,
////          TJSP = 2,
////          SPTG = 3
////      }
////
////      public interface IElementState
////      {
////          StateEnum ElementState { get; set; }
////      }
////
////      public class Test
////      {
////          public void ReadData(CefDataReader reader, ICefData data)
////          {
////              IElementState state = data as IElementState;
////              string readerValue = Convert.ToString(reader.ReadValue("sdf"));
////              state.ElementState = (StateEnum)Enum.Parse(typeof(StateEnum),readerValue);
////          }
////      }
////
//
//public class UdtEnumReadDataGenerator extends UdtDataReaderReadDataMethodGenerator
//{
//	private UdtGeneratorContext udtGenCtx;
//	private String propertyName;
//	private String columnName;
//	private UdtElement element;
//	public UdtEnumReadDataGenerator(UdtGeneratorContext udtGenCtx, String propertyName, String columnName, UdtElement element)
//	{
//		this.udtGenCtx = udtGenCtx;
//		this.propertyName = propertyName;
//		this.columnName = columnName;
//		this.element = element;
//	}
//
////
////         *  IElementState.State=
////
//
//	//private Type GetElementEnumType()
//	//{
//	//    return udtGenCtx.ElementEnumTypes[element.ID];
//	//}
//
//	@Override
//	protected BlockSyntax BuildMethodBody()
//	{
//		java.util.ArrayList<StatementSyntax> statements = new java.util.ArrayList<StatementSyntax>();
//		//var elementEnumType = GetElementEnumType();
//		AddTypeAsStatements(statements);
//		AddReadeValueStatements(statements);
//		AddSetValueStatements(statements);
//		return SyntaxFactory.Block(statements.toArray(new StatementSyntax[]{}));
//	}
//
//	private void AddTypeAsStatements(java.util.ArrayList<StatementSyntax> statements)
//	{
//		statements.add(SyntaxFactory.LocalDeclarationStatement(SyntaxFactory.VariableDeclaration(TypeUtils.GetTypeSyntax(udtGenCtx.RootDataInterfaceType)).WithVariables(SyntaxFactory.<VariableDeclaratorSyntax>SingletonSeparatedList(SyntaxFactory.VariableDeclarator(SyntaxFactory.Identifier("cData")).WithInitializer(SyntaxFactory.EqualsValueClause(SyntaxFactory.BinaryExpression(SyntaxKind.AsExpression, SyntaxFactory.IdentifierName("data"), TypeUtils.GetTypeSyntax(udtGenCtx.RootDataInterfaceType))))))));
//	}
//
//	private void AddReadeValueStatements(java.util.ArrayList<StatementSyntax> statements)
//	{
//		statements.add(SyntaxFactory.LocalDeclarationStatement(SyntaxFactory.VariableDeclaration(SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.StringKeyword))).WithVariables(SyntaxFactory.<VariableDeclaratorSyntax>SingletonSeparatedList(SyntaxFactory.VariableDeclarator(SyntaxFactory.Identifier("readerValue")).WithInitializer(SyntaxFactory.EqualsValueClause(SyntaxFactory.InvocationExpression(SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, TypeUtils.GetTypeSyntax(Convert.class), SyntaxFactory.IdentifierName("ToString"))).WithArgumentList(SyntaxFactory.ArgumentList(SyntaxFactory.<ArgumentSyntax>SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.InvocationExpression(SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, SyntaxFactory.IdentifierName("reader"), SyntaxFactory.IdentifierName("ReadValue"))).WithArgumentList(SyntaxFactory.ArgumentList(SyntaxFactory.<ArgumentSyntax>SingletonSeparatedList(SyntaxFactory.Argument(SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(columnName))))))))))))))));
//	}
//
//	private void AddSetValueStatements(java.util.ArrayList<StatementSyntax> statements)
//	{
////C# TO JAVA CONVERTER TODO TASK: There is no equivalent to implicit typing in Java:
//		var typeSyntax = TypeUtils.ParseGeneratedSyntax(udtGenCtx.ElementEnumTypes[element.ID].FullName);
//		statements.add(SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression(SyntaxKind.SimpleAssignmentExpression, SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, SyntaxFactory.IdentifierName("cData"), SyntaxFactory.IdentifierName(propertyName)), SyntaxFactory.CastExpression(typeSyntax, SyntaxFactory.InvocationExpression(SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, TypeUtils.GetTypeSyntax(Enum.class), SyntaxFactory.IdentifierName("Parse"))).WithArgumentList(SyntaxFactory.ArgumentList(SyntaxFactory.<ArgumentSyntax>SeparatedList(new SyntaxNodeOrToken[]{ SyntaxFactory.Argument(SyntaxFactory.TypeOfExpression(typeSyntax)), SyntaxFactory.Token(SyntaxKind.CommaToken), SyntaxFactory.Argument(SyntaxFactory.IdentifierName("readerValue")) })))))));
//	}
//}